package aufgabe_2_test.try01;

public class WorkerObject {
	String identifier;
	int port;
	
	public WorkerObject(String identifier, int port) {
		this.identifier = identifier;
		this.port = port;
	}
	
	public void setIdentifier(String identifier) {
		this.identifier = identifier;
	}
	
	public void setPort(int port) {
		this.port = port;
	}
	
	public int getPort() {
		return port;
	}
	
	public String getIdentifier() {
		return identifier;
	}
	
	@Override
	public boolean equals(Object arg0) {
		if(this.getClass() == arg0.getClass()){
			if(arg0 instanceof WorkerObject){
				WorkerObject wO = (WorkerObject) arg0;
				if(wO.identifier.equals(this.identifier) && wO.port == this.port){
					return true;
				}
			}
		}
		return false;
	}

}
